<?php namespace Home\Controller;
use Hdphp\Controller\Controller;
class UserController extends Controller{
	private $model;
	public function __init(){
		$this->model=new \Common\Model\User;
	}
	public function register(){
		if(IS_POST){
			if($this->model->store()){
				View::success('注册成功',U('login'));
			}
			View::error($this->model->getError());
		}
		View::make();
	}
	public function login(){
		if(IS_POST){
//			p($_POST);
			if($this->model->login()){
//				die;
				View::success('登陆成功',U('Index/index'));
			}
//			die;
			View::error($this->model->getError());
		}
		View::make();
	}
	public function code(){
		Code::width(200)->height(100)->num(1)->fontSize(50)->make();
	}
}


 ?>